//
//  YueKaCell.m
//  Shengzhuli
//
//  Created by subook on 2017/10/9.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "YueKaCell.h"
#import "UIImage+Extension.h"

@interface YueKaCell()

@property (nonatomic, strong)UIImageView *iconImageView;
@property (nonatomic, strong)UILabel *titleLabel;
@property (nonatomic, strong)UILabel *nameLabel;
@property (nonatomic, strong)UILabel *nameDescribeLabel;
@property (nonatomic, strong)UILabel *seeNumLabel;

@end
@implementation YueKaCell

- (void)awakeFromNib {
    [super awakeFromNib];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createUI];
    }
    return self;
}
- (void)createUI {
    _iconImageView = [[UIImageView alloc] initWithFrame:(CGRectMake(10, 10, 80, 80))];
    _iconImageView.image = [UIImage imageNamed:@"beijngtu"];
    _iconImageView.layer.cornerRadius = 40;
    _iconImageView.layer.masksToBounds = YES;
    [self.contentView addSubview:_iconImageView];
    _titleLabel = [[UILabel alloc] initWithFrame:(CGRectMake(100, 10, ScreenW-100, 20))];
    _titleLabel.font = [UIFont systemFontOfSize:14];
    _titleLabel.text = @"人气美女，年度最佳气质提名人";
    [self.contentView addSubview:_titleLabel];
    
    _nameLabel = [[UILabel alloc] initWithFrame:(CGRectMake(100, 35, 80, 20))];
    _nameLabel.font = [UIFont systemFontOfSize:13];
    _nameLabel.text = @"佳佳";
    [self.contentView addSubview:_nameLabel];
    _nameDescribeLabel = [[UILabel alloc] initWithFrame:(CGRectMake(180, 35, ScreenW-180, 20))];
    _nameDescribeLabel.text = @"你好我是小美女一枚";
    _nameDescribeLabel.textColor = [UIColor lightGrayColor];
    _nameDescribeLabel.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:_nameDescribeLabel];
    
    _seeNumLabel = [[UILabel alloc] initWithFrame:(CGRectMake(100, 60, ScreenW-100, 20))];
    _seeNumLabel.font = [UIFont systemFontOfSize:12];
    _seeNumLabel.textColor = [UIColor lightGrayColor];
    _seeNumLabel.text = @"30人拜访过";
    [self.contentView addSubview:_seeNumLabel];
    
}
- (void)updateCellWithModel:(YueListModel *)model {
    [_iconImageView sd_setImageWithURL:[NSURL URLWithString:model.portraitUrl]];
    _titleLabel.text = model.headings;
    _nameLabel.text = model.name;
    _nameDescribeLabel.text = model.introduce;
    _seeNumLabel.text = [model.num stringByAppendingString:@"人拜访过"];
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

@end
